﻿using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using WebApiClientCore.Attributes;
using XUCore.WeChat.Apis;

namespace XUCore.WeChat.Enterprise.Apis.Ticket
{
    [HttpHost("https://qyapi.weixin.qq.com/cgi-bin/")]
    public interface IEnterpriseTicketApi : IWeChatApiBase
    {
        /// <summary>
        /// 获取企业的jsapi_ticket   该jsapi_ticket只能用于wx.config接口计算签名
        /// </summary>
        /// <param name="access_token"></param>
        /// <returns></returns>
        [HttpGet("get_jsapi_ticket")]
        Task<EnterpriseTicketApiResult> GetEnterpriseAsync([Required] string access_token);
        /// <summary>
        /// 获取应用的jsapi_ticket
        /// </summary>
        /// <param name="access_token"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        [HttpGet("ticket/get")]
        Task<EnterpriseTicketApiResult> GetAgentAsync([Required] string access_token, string type = "agent_config");
    }
}